Integrand size = 23, antiderivative size = 74 \[ \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=-\frac {\sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a}}\right )}{f}+\frac {\sqrt {a-b} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a-b}}\right )}{f} \]
[Out]
Time = 0.13 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3751, 457, 85, 65, 214} \[ \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\frac {\sqrt {a-b} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a-b}}\right )}{f}-\frac {\sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a}}\right )}{f} \]
[In]
[Out]
Rule 65
Rule 85
Rule 214
Rule 457
Rule 3751
Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {\sqrt {a+b x^2}}{x \left (1+x^2\right )} \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {\text {Subst}\left (\int \frac {\sqrt {a+b x}}{x (1+x)} \, dx,x,\tan ^2(e+f x)\right )}{2 f} \\ & = \frac {a \text {Subst}\left (\int \frac {1}{x \sqrt {a+b x}} \, dx,x,\tan ^2(e+f x)\right )}{2 f}-\frac {(a-b) \text {Subst}\left (\int \frac {1}{(1+x) \sqrt {a+b x}} \, dx,x,\tan ^2(e+f x)\right )}{2 f} \\ & = \frac {a \text {Subst}\left (\int \frac {1}{-\frac {a}{b}+\frac {x^2}{b}} \, dx,x,\sqrt {a+b \tan ^2(e+f x)}\right )}{b f}-\frac {(a-b) \text {Subst}\left (\int \frac {1}{1-\frac {a}{b}+\frac {x^2}{b}} \, dx,x,\sqrt {a+b \tan ^2(e+f x)}\right )}{b f} \\ & = -\frac {\sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a}}\right )}{f}+\frac {\sqrt {a-b} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a-b}}\right )}{f} \\ \end{align*}
Time = 0.07 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.97 \[ \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\frac {-\sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a}}\right )+\sqrt {a-b} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a-b}}\right )}{f} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(583\) vs. \(2(62)=124\).
Time = 1.06 (sec) , antiderivative size = 584, normalized size of antiderivative = 7.89
method | result | size |
default | \(-\frac {\sqrt {a +b \tan \left (f x +e \right )^{2}}\, \left (-2 \ln \left (4 \cos \left (f x +e \right ) \sqrt {a -b}\, \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}+4 \cos \left (f x +e \right ) a -4 b \cos \left (f x +e \right )+4 \sqrt {a -b}\, \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}\right ) a^{\frac {3}{2}}+a \ln \left (-\frac {4 \left (\cos \left (f x +e \right ) \sqrt {a}\, \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}+\cos \left (f x +e \right ) a -b \cos \left (f x +e \right )+\sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}\, \sqrt {a}+b \right )}{\cos \left (f x +e \right )-1}\right ) \sqrt {a -b}+2 \ln \left (4 \cos \left (f x +e \right ) \sqrt {a -b}\, \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}+4 \cos \left (f x +e \right ) a -4 b \cos \left (f x +e \right )+4 \sqrt {a -b}\, \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}\right ) \sqrt {a}\, b -\ln \left (\frac {2 \cos \left (f x +e \right ) \sqrt {a}\, \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}+2 \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}\, \sqrt {a}-2 \cos \left (f x +e \right ) a +2 b \cos \left (f x +e \right )+2 b}{\sqrt {a}\, \left (\cos \left (f x +e \right )+1\right )}\right ) \sqrt {a -b}\, a \right ) \cos \left (f x +e \right )}{2 f \sqrt {a}\, \sqrt {a -b}\, \left (\cos \left (f x +e \right )+1\right ) \sqrt {\frac {a \cos \left (f x +e \right )^{2}-b \cos \left (f x +e \right )^{2}+b}{\left (\cos \left (f x +e \right )+1\right )^{2}}}}\) | \(584\) |
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 382, normalized size of antiderivative = 5.16 \[ \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\left [\frac {\sqrt {a - b} \log \left (\frac {b \tan \left (f x + e\right )^{2} + 2 \, \sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {a - b} + 2 \, a - b}{\tan \left (f x + e\right )^{2} + 1}\right ) + \sqrt {a} \log \left (\frac {b \tan \left (f x + e\right )^{2} - 2 \, \sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {a} + 2 \, a}{\tan \left (f x + e\right )^{2}}\right )}{2 \, f}, \frac {2 \, \sqrt {-a + b} \arctan \left (-\frac {\sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {-a + b}}{a - b}\right ) + \sqrt {a} \log \left (\frac {b \tan \left (f x + e\right )^{2} - 2 \, \sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {a} + 2 \, a}{\tan \left (f x + e\right )^{2}}\right )}{2 \, f}, \frac {2 \, \sqrt {-a} \arctan \left (\frac {\sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {-a}}{a}\right ) + \sqrt {a - b} \log \left (\frac {b \tan \left (f x + e\right )^{2} + 2 \, \sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {a - b} + 2 \, a - b}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, f}, \frac {\sqrt {-a} \arctan \left (\frac {\sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {-a}}{a}\right ) + \sqrt {-a + b} \arctan \left (-\frac {\sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {-a + b}}{a - b}\right )}{f}\right ] \]
[In]
[Out]
\[ \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\int \sqrt {a + b \tan ^{2}{\left (e + f x \right )}} \cot {\left (e + f x \right )}\, dx \]
[In]
[Out]
Exception generated. \[ \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
Exception generated. \[ \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=\text {Exception raised: TypeError} \]
[In]
[Out]
Time = 0.31 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.12 \[ \int \cot (e+f x) \sqrt {a+b \tan ^2(e+f x)} \, dx=-\frac {\sqrt {a}\,\mathrm {atanh}\left (\frac {\sqrt {b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a}}{\sqrt {a}}\right )}{f}-\frac {\mathrm {atanh}\left (\frac {a\,b^3\,\sqrt {b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a}\,\sqrt {a-b}}{a\,b^4-a^2\,b^3}\right )\,\sqrt {a-b}}{f} \]
[In]
[Out]